package com.nxk.modules.content.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nxk.modules.content.entity.ConCase;
import com.nxk.modules.content.service.ConCaseService;
import com.nxk.modules.core.entity.BaseEntity;
import com.nxk.modules.exception.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/web/api/case")
public class CaseApiController {

    @Autowired
    private ConCaseService conCaseService;


    @PostMapping("/caseDetail")
    public ResultEntity caseDetail(ConCase conCase){
        QueryWrapper<ConCase> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("status", BaseEntity.STATUS_NORMAL);
        queryWrapper.orderByAsc("sort");
        List<ConCase> list = conCaseService.list(queryWrapper);
        return ResultEntity.success(list);
    }

}
